<template>
  <div>
    <h2>我是count组件</h2>
    <p>count:{{count}}</p>
    <p>name:{{name}}</p>
    <p>title:{{title}}</p>
    <p>otherTitle:{{otherTitle}}</p>
  </div>
</template>


<script>
export default {
  name:"count",
    data(){
      return{
        count1:this.count
      }
    },
    //接收父组件传过来的值
    props:{
      count:Number,
      name:String,
      title:String,
      otherTitle: {
        type:String,
        // require:true,
        default:"ok"
      }
    },
    methods:{
      add(){
        //Count组件实例对象
        console.log(this);
        console.log(this.count)
        console.log(this.$props.count)
      }
    }
}
</script>


<style></style>